home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00a.txt / 000026_icon-group-sender _Mon Feb 7 08:17:47 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA08396
  4.     for icon-group-addresses; Mon, 7 Feb 2000 08:16:27 -0700 (MST)
  5. Message-Id: <200002071516.IAA08396@baskerville.CS.Arizona.EDU>
  6. Date: Sun, 6 Feb 2000 23:57:50 -0200 (EDT)
  7. From: Andrzej Solecki <andsol@mtm.ufsc.br>
  8. To: icon-group@optima.CS.Arizona.EDU
  9. Subject: factors.icn
  10. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  11. Status: RO
  12.  
  13.    I've imagined that such a program (call it `fct.icn') would behave
  14. as nicely as FreeBSD `factor' command:
  15.         link factors
  16.         procedure main(args)
  17.         writes(args[1],": ")
  18.         every writes(!factors(args[1])," ")
  19.         write()
  20.         end
  21. but it returns only one factor if the number has just two (distinct)
  22. ones. Some numbers (like 99) are also discriminated. Is it a feature
  23. or an unexpected feature of `factors.icn'? Or anything wrong about
  24. the way the list is formed?
  25.    Besides, it chokes soon enough even when one of the factors
  26. is reasonably small, say `./fct 33285' returns `33285 - 3 5 7'. Any
  27. simple explanation, please? A quick look at `factors.icn' - at my level
  28. of ignorance - does not furnish any clues :(
  29.                 Andrzej Solecki        
  30.  
  31.